class HomeMenuModel {
  int ret;
  Data data;
  String msg;

  HomeMenuModel({this.ret, this.data, this.msg});

  HomeMenuModel.fromJson(Map<String, dynamic> json) {
    ret = json['ret'];
    data = json['data'] != null ? new Data.fromJson(json['data']) : null;
    msg = json['msg'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['ret'] = this.ret;
    if (this.data != null) {
      data['data'] = this.data.toJson();
    }
    data['msg'] = this.msg;
    return data;
  }
}

class Data {
  int total;
  List<Rows> rows;
  List<String> fieldCnName;
  List<String> fieldAliasName;

  Data({this.total, this.rows, this.fieldCnName, this.fieldAliasName});

  Data.fromJson(Map<String, dynamic> json) {
    total = json['total'];
    if (json['rows'] != null) {
      rows = new List<Rows>();
      json['rows'].forEach((v) {
        rows.add(new Rows.fromJson(v));
      });
    }
    fieldCnName = json['fieldCnName'].cast<String>();
    fieldAliasName = json['fieldAliasName'].cast<String>();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['total'] = this.total;
    if (this.rows != null) {
      data['rows'] = this.rows.map((v) => v.toJson()).toList();
    }
    data['fieldCnName'] = this.fieldCnName;
    data['fieldAliasName'] = this.fieldAliasName;
    return data;
  }
}

class Rows {
  List titleList;
  int aFM1;
  String aFM10;
  int aFM12;
  int aFM13;
  String aFM4;
  int aFM6;
  int aFM7;
  String aFM9;
  String dICAFM13;
  String dICAFM6;
  String dICGAFM12;
  int iD;
  int lMFID;
  int lMFPAGEID;
  String nAME;
  int pARENTIDATM40347;
  String pKPRODUCTTYPEATM31351;
  String pNAME;
  String rEGULAR128DICAFM12;
  String rEGULARAFM12;
  String sUBJECT;
  int t3470;

  Rows(
      {this.aFM1,
        this.aFM10,
        this.aFM12,
        this.aFM13,
        this.aFM4,
        this.aFM6,
        this.aFM7,
        this.aFM9,
        this.dICAFM13,
        this.dICAFM6,
        this.dICGAFM12,
        this.iD,
        this.lMFID,
        this.lMFPAGEID,
        this.nAME,
        this.pARENTIDATM40347,
        this.pKPRODUCTTYPEATM31351,
        this.pNAME,
        this.rEGULAR128DICAFM12,
        this.rEGULARAFM12,
        this.sUBJECT,
        this.titleList,
        this.t3470});

  Rows.fromJson(Map<String, dynamic> json) {
    var subsString = json['SUBJECT'];
    List subsArr = subsString.split(",");
    List <String>realList = [];
    for (int i =0 ;i <subsArr.length ;i++){
      realList.add(subsArr[i].split("_")[0]);
    }
    titleList = realList;
    aFM1 = json['AFM_1'];
    aFM10 = json['AFM_10'];
    aFM12 = json['AFM_12'];
    aFM13 = json['AFM_13'];
    aFM4 = json['AFM_4'];
    aFM6 = json['AFM_6'];
    aFM7 = json['AFM_7'];
    aFM9 = json['AFM_9'];
    dICAFM13 = json['DIC_AFM_13'];
    dICAFM6 = json['DIC_AFM_6'];
    dICGAFM12 = json['DIC_G_AFM_12'];
    iD = json['ID'];
    lMFID = json['LMF_ID'];
    lMFPAGEID = json['LMF_PAGEID'];
    nAME = json['NAME'];
    pARENTIDATM40347 = json['PARENT_ID_ATM_4_0_347'];
    pKPRODUCTTYPEATM31351 = json['PK_PRODUCT_TYPE_ATM_3_1_351'];
    pNAME = json['P_NAME'];
    rEGULAR128DICAFM12 = json['REGULAR_128_DIC_AFM_12'];
    rEGULARAFM12 = json['REGULAR_AFM_12'];
    sUBJECT = json['SUBJECT'];
    t3470 = json['T_347_0'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['AFM_1'] = this.aFM1;
    data['AFM_10'] = this.aFM10;
    data['AFM_12'] = this.aFM12;
    data['AFM_13'] = this.aFM13;
    data['AFM_4'] = this.aFM4;
    data['AFM_6'] = this.aFM6;
    data['AFM_7'] = this.aFM7;
    data['AFM_9'] = this.aFM9;
    data['DIC_AFM_13'] = this.dICAFM13;
    data['DIC_AFM_6'] = this.dICAFM6;
    data['DIC_G_AFM_12'] = this.dICGAFM12;
    data['ID'] = this.iD;
    data['LMF_ID'] = this.lMFID;
    data['LMF_PAGEID'] = this.lMFPAGEID;
    data['NAME'] = this.nAME;
    data['PARENT_ID_ATM_4_0_347'] = this.pARENTIDATM40347;
    data['PK_PRODUCT_TYPE_ATM_3_1_351'] = this.pKPRODUCTTYPEATM31351;
    data['P_NAME'] = this.pNAME;
    data['REGULAR_128_DIC_AFM_12'] = this.rEGULAR128DICAFM12;
    data['REGULAR_AFM_12'] = this.rEGULARAFM12;
    data['SUBJECT'] = this.sUBJECT;
    data['T_347_0'] = this.t3470;
    return data;
  }
}